package us.gaaoc.framework.webapp.backingbeans.agent.reports;

import javax.faces.context.FacesContext;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.transaction.annotation.Transactional;

import us.gaaoc.framework.webapp.backingbeans.BaseBackingBean;

public class CaseStatistics extends BaseBackingBean {

	/** Generated Serial Version UID */
	private static final long serialVersionUID = -2294014128939333917L;

	// CaseStatistics
	private int numberOfCases;
	private int numberOfContemptCases;
	private int numberOfEstablishedCases;
	private int numberOfLocalCases;
	
	private String courtUuid;

	public int getNumberOfCases() {
		courtUuid = (String) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("courtUuid");
		numberOfCases = this.getModelFacade().countCaseRecords(courtUuid);
		// System.out.println("numberOfCases="+numberOfCases);
		return numberOfCases;
	}

	public void setNumberOfCases(int numberOfCases) {
		this.numberOfCases = numberOfCases;
	}

	public int getNumberOfContemptCases() {
		numberOfContemptCases = this.getModelFacade().countContemptCases(courtUuid);
		// System.out.println("numberOfContemptCases="+numberOfContemptCases);
		return numberOfContemptCases;
	}

	public void setNumberOfContemptCases(int numberOfContemptCases) {
		this.numberOfContemptCases = numberOfContemptCases;
	}

	public int getNumberOfEstablishedCases() {
		numberOfEstablishedCases = this.getModelFacade()
				.countEstablishedCases(courtUuid);
		//System.out.println("numberOfEstablishedCases="+numberOfEstablishedCases
		// );
		return numberOfEstablishedCases;
	}

	public void setNumberOfEstablishedCases(int numberOfEstablishedCases) {
		this.numberOfEstablishedCases = numberOfEstablishedCases;
	}

	public int getNumberOfLocalCases() {
		numberOfLocalCases = this.getModelFacade().countLocalCases(courtUuid);
		// System.out.println("numberOfLocalCases="+numberOfLocalCases);
		return numberOfLocalCases;
	}

	public void setNumberOfLocalCases(int numberOfLocalCases) {
		this.numberOfLocalCases = numberOfLocalCases;
	}

	public String back() {
		return "back";
	}

	public String goToCaseStatisticsByMonth() {
		return "goToCaseStatisticsByMonth";
	}

	public String goToCaseStatisticsByDay() {
		return "goToCaseStatisticsByDay";
	}

}